<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>JQuery - 3</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width">
        <style>
            #zoneCaseCocher {
                list-style: none;
            }
            
            

        </style>
        <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
        <script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
        <script>
            $(document).ready(function(){
                $("#cocher_decocher_toutes").click(function(){
                    if($('input').attr('checked')=='checked'){
                        $('input').attr('checked', true);
                    }
                    else{
                        $('input').removeAttr('checked');
                    }
                });
            });
        </script>
    </head>
    <body>
        <form name="form1" action="">
            <div><input type="checkbox" name="cocher_decocher_toutes" id="cocher_decocher_toutes" value="1" >Cocher / Décocher toutes les cases</div>
            <ol id="zoneCaseCocher">
                <li><input type="checkbox" name="case_1" id="case_1" value="1" > Case à cocher 1</li>
                <li><input type="checkbox" name="case_2" id="case_2" value="1" > Case à cocher 2</li>
                <li><input type="checkbox" name="case_1" id="case_3" value="1" > Case à cocher 3</li>
                <li><input type="checkbox" name="case_1" id="case_4" value="1" > Case à cocher 4</li>
            </ol>
        </form>
    </body>
</html>
